// .txt

beginzonescript;

variables;

short crime_tolerance = 5;
short last_abil;
short i;

body;

beginstate INIT_STATE;


	set_name(19,"Parsel");
	set_level(19,28);
	set_boss_level(19,1);
	set_new_abil(19,10);
	set_attack_bonus(19,10);

	set_name(20,"Aiken");
	set_name(21,"Rummus");

	set_name(22,"Sage Mendoa");
	set_level(22,28);
	set_boss_level(22,1);
	set_new_abil(22,5);
	set_attack_bonus(22,10);

	set_name(23,"Jesstres");
	set_level(23,28);
	set_boss_level(23,1);
	set_attack_bonus(23,6);

	set_level(25,20);
	set_level(29,20);
	set_level(30,20);
	set_level(31,20);
	
	add_range_to_group(32,38,1);
	add_range_to_group(44,50,2);

	if (get_sdf(34,1) > 0) {
		make_zone_hostile();
		}
		else if (gf(100,6) == 2) {
			print_str_color("This is a friendly settlement. You are able to rest.",2);
			revive_party();
			}	

	last_abil = get_current_tick();
	
	set_crime_tolerance(crime_tolerance);
	break;

beginstate EXIT_STATE;

break;

beginstate START_STATE;
	if ((gf(34,1) > 0) && (gf(100,6) == 2)) {
		sf(100,6,3);
		print_str_color("Now that the Haven is angry with you, you will no longer be",3);
		print_str_color("  able to serve Litalia.",3);
		}

	// clear zone?
	//if ((zone_clear(ME) == FALSE) && (get_flag(,) > 0)) {
		//print_str_color("",2);
		//clear_zone(ME);	
		//}
		
	if ((get_crime_level() >= crime_tolerance) && (get_sdf(34,1) == 0)) {
		make_zone_hostile();
		set_flag(34,1,1);
		}

	 if (gf(34,1) == 0) {
		if (gf(100,6) == 2) {
			if (get_ran(1,0,100) < 10)
				give_char_text_bubble(14,"I have a task.");
			if (get_ran(1,0,100) < 10)
				give_char_text_bubble(14,"Our work continues.");
			if (get_ran(1,0,100) < 10)
				give_char_text_bubble(14,"You must trust me.");
			if (get_ran(1,0,100) < 10)
				give_char_text_bubble(14,"It will be hard.");
			}
		if (gf(100,6) < 2) {
			if (get_ran(1,0,100) < 10)
				give_char_text_bubble(14,"Shaping must end.");
			if (get_ran(1,0,100) < 10)
				give_char_text_bubble(14,"The danger is too great.");
			if (get_ran(1,0,100) < 10)
				give_char_text_bubble(14,"I welcome you.");
			}
		if (gf(100,6) == 3) {
			if (get_ran(1,0,100) < 25)
				give_char_text_bubble(14,"Leave this place.");
			}
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(18,"I welcome you.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(18,"I care for our agents.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(18,"Poor Aiken.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(18,"Where is Parsel now?");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(19,"I'll take this.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(19,"Better leave that.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(19,"Where's my pipe?");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(19,"Need some pods.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(19,"Need more bandages.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(20,"Keep watching.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(20,"They are coming.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(20,"They are here.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(21,"Let's trade.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(21,"We need more gear.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(21,"I have some goods.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(22,"Have to hurry.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(22,"Don't let it boil over.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(22,"Ah, the visitor.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(22,"The batons are expecting!");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(23,"We are not weak.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(23,"We will be avenged.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(23,"Don't touch my hoard.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(44 + get_ran(1,0,6),"Shhh!");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(44 + get_ran(1,0,6),"Hear that?");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(44 + get_ran(1,0,6),"Game of dice?");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(44 + get_ran(1,0,6),"When will they come?");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(44 + get_ran(1,0,6),"This is the third Haven.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(44 + get_ran(1,0,6),"How long will we last?");
		}
	
	//if (((is_combat()) && (tick_difference(last_abil,get_current_tick()) > 0)) || ((is_group()) && (tick_difference(last_abil,get_current_tick()) > 5))) {
	//	last_abil = get_current_tick();
	//	}
break;

//beginstate 10;
//break;

//	print_str("");
//	set_terrain_string_range(".",3);
//	set_terrain_string_range("The sign says - .",3);
